Skip to content

Fix critical macOS crash and add icon size configuration#1

Open
ANAVHEOBA wants to merge 1 commit into
spacedriveapp:move-operationfrom
ANAVHEOBA:move-operation
Open

Fix critical macOS crash and add icon size configuration#1
ANAVHEOBA wants to merge 1 commit into
spacedriveapp:move-operationfrom
ANAVHEOBA:move-operation

Conversation

@ANAVHEOBA

Copy link
Copy Markdown

This commit addresses three vital issues:

  1. Fix issue [Tauri] App crashes when using the js api crabnebula-dev/drag-rs#23 - macOS app crashes when using JS API

    • Fixed incorrect NSPoint extraction from backingAlignedRect (line 70)
    • The method returns NSRect, not NSPoint - now properly extracting .origin
    • Fixed callback type mismatch in drop handler (line 273)
    • Changed from Fn(DragResult) to Fn(DragResult, CursorPosition)
  2. Fix issue [bug][v2] Pictures are very large when dragging them crabnebula-dev/drag-rs#41 - Large drag preview images

    • Added optional icon_size field to Options struct
    • Allows users to specify custom icon dimensions (width, height)
    • Implemented on both macOS (using setSize) and Windows (SHDRAGIMAGE)
    • Maintains backward compatibility - None uses original size

Note: These fixes compile successfully but require manual GUI testing on respective platforms to fully verify functionality.

Related issues: crabnebula-dev#23, crabnebula-dev#41

This commit addresses three vital issues:

1. Fix issue crabnebula-dev#23 - macOS app crashes when using JS API
   - Fixed incorrect NSPoint extraction from backingAlignedRect (line 70)
   - The method returns NSRect, not NSPoint - now properly extracting .origin
   - Fixed callback type mismatch in drop handler (line 273)
   - Changed from Fn(DragResult) to Fn(DragResult, CursorPosition)

2. Fix issue crabnebula-dev#41 - Large drag preview images
   - Added optional icon_size field to Options struct
   - Allows users to specify custom icon dimensions (width, height)
   - Implemented on both macOS (using setSize) and Windows (SHDRAGIMAGE)
   - Maintains backward compatibility - None uses original size

Note: These fixes compile successfully but require manual GUI testing
on respective platforms to fully verify functionality.

Related issues: crabnebula-dev#23, crabnebula-dev#41
@Cristian-Vogel

Copy link
Copy Markdown

Hi @ANAVHEOBA,

Thanks a lot for this fix! 🐙 We really appreciate the effort, sorry it has taken a while to get back to you.

We keep the upstream drag‑rs repo here: https://github.com/crabnebula-dev/drag-rs, and we’ve got the same bugs filed as crabnebula-dev#23 and crabnebula-dev#41 in our codebase. Your patches look solid and would be good for everyone using the library.

Would you be up for opening a PR against crabnebula-dev/drag-rs with these changes?

If you’d rather we handle the port, that’s fine too—we’ll make sure to credit your work properly.

Either way, huge thanks for tackling these critical issues!

Best,
@Cristian‑Vogel (CrabNebula team)

@ANAVHEOBA

Copy link
Copy Markdown
Author

Yes, I do that and I also wanted you to know that I would be a great addition to your team, always innovating solution and I want to work in a good team, would love to join your team, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants